#define _GNU_SOURCE
#include "../app/app_pool.h"
#include <unistd.h>

int task_func(void *test)
{
    printf("thread_id: %d, task_func: %s\n",gettid(), (char*)test);
    free(test);
    return 0;
}

int main(void)
{
    // 初始化5个线程的线程池
    app_pool_init(5);
    for (int i = 0; i < 10; i++)
    {
        char*test=malloc(10);
        sprintf(test,"zrc_c---%d",i);
        app_pool_resigterTask(task_func, test);
    }
    sleep(1);
    app_pool_close();
    return 0;
}